<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
  <script>  
    // Vue实例(消息中心)
    const eventBus = new Vue()
    // 注册事件
    eventBus.$on('dataChange', () => {
      console.log('时间处理功能1')
    })
    eventBus.$on('dataChange', () => {
      console.log('时间处理功能2')
    })
    // 触发事件（发布者
    eventBus.$emit('dataChange')
    
  </script>
</body>
</html>